home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume2 / smail-xenix-v3 < prev    next >
Encoding:
Internet Message Format  |  1991-08-07  |  21.1 KB

  1. From: chip@ateng.UUCP (Chip Salzenberg)
  2. Newsgroups: comp.sources.misc
  3. Subject: v02i003: Smail under Xenix -- USE THIS ONE!!!
  4. Message-ID: <6966@ncoast.UUCP>
  5. Date: 7 Jan 88 03:18:18 GMT
  6. Approved: allbery@ncoast.UUCP
  7.  
  8. Comp.sources.misc: Volume 2, Issue 3
  9. Archive-Name: smail-xenix-v3
  10. Submitted-By: chip@ateng.UUCP (Chip Salzenberg)
  11.  
  12. Brandon:
  13.  
  14. Recently, you sent out a small patch to smail that I made and then posted
  15. in comp.unix.xenix.  I did *not* intend that patch for comp.sources.misc!
  16. I was working on a complete set of patches that would take a stock smail
  17. 2.5 and make it usable under Xenix.  Well, here it is.  Please post this.
  18. [Then why did you send it to sources-misc@ncoast?  ++bsa]
  19.  
  20. BTW, I earlier posted a sharchive of smail mods to comp.unix.xenix.  For all
  21. you readers of c.u.x that used those mods --
  22.                       USE THESE NEW PATCHES INSTEAD.
  23. Why?
  24.     1.  Cleaner mods
  25.     2.  Better comments
  26.     3.  Explicit support for Micnet/Xenix-Net
  27.     4.  Support for /etc/systemid file (no need to relink your
  28.         kernel to change your machine name)
  29.  
  30. Herein you will find a sharchive that contains a new Makefile, a set of
  31. patches to the smail sources, a replacement for the troublesome
  32. /usr/lib/mail/execmail program, and a script to install them both.
  33.  
  34. All a Xenix user needs to start running smail is (1) the smail 2.5 sources,
  35. (2) this sharchive, and (3) Larry Wall's patch program.
  36.  
  37. "Shar and enjoy."
  38.  
  39. #! /bin/sh
  40. # This is a shell archive, meaning:
  41. # 1. Remove everything above the "#! /bin/sh" line.
  42. # 2. Save the resulting text in a file.
  43. # 3. Execute the file with /bin/sh (not csh) to create the files:
  44. #    X.README
  45. #    X.PATCHES
  46. #    Makefile
  47. #    execm.c
  48. #    install_smail
  49. # This archive created: Tue Dec 29 10:41:42 1987
  50. export PATH; PATH=/bin:$PATH
  51. :
  52. echo 'shar: extracting "X.README" (2816 characters) '
  53. if test -f 'X.README'
  54. then
  55.     echo 'shar: will not overwrite existing file "X.README" '
  56. else
  57. sed 's/^X//' << \SHAR_EOF > 'X.README'
  58. XX.README
  59. X
  60. XThis file describes how to use my smail 2.5 patches for SCO Xenix System V.
  61. X
  62. XTo use these patches, you need either (1) Larry Wall's "patch" program, or
  63. X(2) lots of patience while you apply these changes by hand.
  64. X
  65. XSo, here it is:
  66. X
  67. X        1.  Find your original, untouched smail 2.5 sources.  Copy these
  68. X            to a new directory.  (We'll call it "/usr/src/xsmail".)
  69. X
  70. X        2.  Move the files in this sharchive (Makefile, X.README,
  71. X            X.PATCHES, execm.c, install_smail) into /usr/src/xsmail.
  72. X            This will overwrite the distributed Makefile.
  73. X
  74. X        3.  Run "patch <X.PATCHES".  No patches should fail; if any do,
  75. X            then you probably started with modified sources or with the
  76. X            wrong version of smail.
  77. X
  78. X            (This step will leave ".orig" files lying around.  You may
  79. X            remove these at any time, but I'd leave them until installation
  80. X            is complete just to be on the safe side.  And if any patches
  81. X            fail, those patches will be in ".rej" files.)
  82. X
  83. X        4.  Examine defs.h and configure it for your installation.
  84. X            Specifically, if you're running Micnet or Xenix-Net, you'll
  85. X            probably want to uncomment "#define MICNET".  (Or you can
  86. X            define it in the Makefile.)
  87. X
  88. X        5.  Run "make" to make smail and execm.
  89. X
  90. X        6.  >As root<, run "./install_smail".
  91. X
  92. XIf you do the above steps, the following will have occurred:
  93. X
  94. X        Smail is installed as /usr/bin/smail.
  95. X
  96. X        /usr/bin/rmail is moved to /usr/bin/rmail.x and never used again.
  97. X
  98. X        /usr/bin/smail is linked to /usr/bin/rmail.
  99. X
  100. X        /usr/lib/mail/execmail is moved to /usr/lib/mail/execmail.x, which
  101. X        smail uses for delivering local mail. (If you define MICNET when
  102. X        compiling smail, then execmail.x is used for delivering _all_ mail,
  103. X        not just local mail.)
  104. X
  105. X        The program execm.c is installed as /usr/lib/mail/execmail.  This
  106. X        "fake" execmail just parses its arguments and executes smail.  I
  107. X        would have just linked /usr/bin/smail to /usr/lib/mail/execmail,
  108. X        but their arguments are different.  (The /bin/mail program uses
  109. X        execmail to do its work.)
  110. X
  111. XUsers of /bin/mail note:  If you want to use Internet-style addresses with
  112. X/bin/mail, you have to add the line "set execmail" to /usr/lib/mail/mailrc.
  113. XOtherwise, /bin/mail assumes that addresses without bangs must be valid
  114. Xlocal users.
  115. X
  116. XOne final comment:  I'd like to have some idea of how widely used these
  117. Xpatches are.  So when you get it working -- or if you can't! -- drop me a
  118. Xline and tell me about it. (My address is chip@ateng.  If you can't get a
  119. Xvalid path, try codas!ateng!chip or uunet!ateng!chip.)
  120. X
  121. X        28 December 1987
  122. X        Chip Salzenberg <chip@ateng.UUCP>
  123. X        A T Engineering, Tampa, FL
  124. SHAR_EOF
  125. if test 2816 -ne `wc -c < 'X.README'`
  126. then
  127.     echo 'shar: error transmitting "X.README" (should have been 2816 characters) '
  128. fi
  129. chmod 644 'X.README'
  130. fi  # end of overwriting check
  131. :
  132. echo 'shar: extracting "X.PATCHES" (10886 characters) '
  133. if test -f 'X.PATCHES'
  134. then
  135.     echo 'shar: will not overwrite existing file "X.PATCHES" '
  136. else
  137. sed 's/^X//' << \SHAR_EOF > 'X.PATCHES'
  138. X
  139. XIndex: alias.c
  140. X*** ../smail2.5/alias.c    Mon Dec 21 18:29:55 1987
  141. X--- ../smail/alias.c    Thu Sep 24 13:00:56 1987
  142. X***************
  143. X*** 460,462 ****
  144. X  
  145. X!     while((*p != NULL) && (*p != '#')) {
  146. X          b = p;
  147. X--- 460,462 ----
  148. X  
  149. X!     while((*p != '\0') && (*p != '#')) {
  150. X          b = p;
  151. X
  152. XIndex: defs.h
  153. X*** ../smail2.5/defs.h    Mon Dec 21 18:29:57 1987
  154. X--- ../smail/defs.h    Mon Dec 28 09:45:49 1987
  155. X***************
  156. X*** 18,19 ****
  157. X--- 18,47 ----
  158. X  
  159. X+ /*
  160. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  161. X+ **    Released to Usenet on 01 Dec 1987.
  162. X+ **    Further modified 23 Dec 1987.
  163. X+ **
  164. X+ **    Additions:
  165. X+ **
  166. X+ **        EXECMAIL is defined as the renamed /usr/lib/mail/execmail.
  167. X+ **        Under Xenix, this is the local delivery agent.
  168. X+ **
  169. X+ **        SMARTMAILER is now automatically defined if either SENDMAIL
  170. X+ **        or EXECMAIL is defined.  This is useful for code that depends
  171. X+ **        on properties that these programs have in common (automatic
  172. X+ **        bouncing of failed mail, for example).
  173. X+ **
  174. X+ **        MICNET should be defined if Micnet or Xenix-Net is in use.
  175. X+ **        In this case, execmail is used for _all_ mail, which allows
  176. X+ **        the automatic routing of UUCP mail to a gateway.  However,
  177. X+ **        execmail sends one file per recipient, even if the recipients
  178. X+ **        are all on the same (remote) machine.  This is not exactly
  179. X+ **        a bug; it just increases UUCP connect time.  I personally
  180. X+ **        leave MICNET undefined.
  181. X+ **
  182. X+ **        HOSTFILE is the name of a file containing the hostname.
  183. X+ **        Under Xenix, this is "/etc/systemid".  HOSTFILE overrides
  184. X+ **        UNAME/GETHOSTNAME.
  185. X+ */
  186. X+ 
  187. X  #ifndef VERSION
  188. X***************
  189. X*** 32,34 ****
  190. X  
  191. X! /* if defined, HOSTNAME overrides UNAME and GETHOSTNAME */
  192. X  /*#define HOSTNAME    "host"        /* literal name */
  193. X--- 60,69 ----
  194. X  
  195. X! /* if defined, HOSTFILE overrides UNAME and GETHOSTNAME */
  196. X! #ifndef HOSTFILE
  197. X! #ifdef M_XENIX
  198. X! #define HOSTFILE    "/etc/systemid"    /* read host name from this file */
  199. X! #endif
  200. X! #endif
  201. X! 
  202. X! /* if defined, HOSTNAME overrides HOSTFILE, UNAME, and GETHOSTNAME */
  203. X  /*#define HOSTNAME    "host"        /* literal name */
  204. X***************
  205. X*** 105,107 ****
  206. X  
  207. X! #define ALIAS    "/usr/lib/aliases"    /* location of mail aliases       */
  208. X  /*#define CASEALIAS            /* make aliases case sensitive    */
  209. X--- 140,147 ----
  210. X  
  211. X!     /* Location of mail aliases */
  212. X! #ifdef M_XENIX
  213. X! #define ALIAS   "/usr/lib/mail/saliases"
  214. X! #else
  215. X! #define ALIAS   "/usr/lib/aliases"
  216. X! #endif
  217. X  /*#define CASEALIAS            /* make aliases case sensitive    */
  218. X***************
  219. X*** 125,126 ****
  220. X--- 165,170 ----
  221. X  
  222. X+     /* list of Full Name, address pairs */
  223. X+ #ifdef M_XENIX
  224. X+ #define FULLNAME        "/usr/lib/mail/fullnames"
  225. X+ #else
  226. X  #define FULLNAME    "/usr/lib/fullnames"
  227. X***************
  228. X*** 126,128 ****
  229. X  #define FULLNAME    "/usr/lib/fullnames"
  230. X!                     /* list of Full Name, address pairs */
  231. X  
  232. X--- 170,172 ----
  233. X  #define FULLNAME    "/usr/lib/fullnames"
  234. X! #endif
  235. X  
  236. X***************
  237. X*** 144,146 ****
  238. X  
  239. X! /*#define LOG    "/usr/spool/uucp/mail.log"    /* log of uucp mail */
  240. X  /*#define RECORD    "/tmp/mail.log"        /* record of uucp mail */
  241. X--- 188,190 ----
  242. X  
  243. X! #define LOG    "/usr/spool/uucp/mail.log"    /* log of uucp mail */
  244. X  /*#define RECORD    "/tmp/mail.log"        /* record of uucp mail */
  245. X***************
  246. X*** 162,165 ****
  247. X  
  248. X! #ifndef SMAIL
  249. X! #define SMAIL        "/bin/smail"    /* location of smail command */
  250. X  #endif
  251. X--- 206,212 ----
  252. X  
  253. X! #ifndef SMAIL       /* location of smail command */
  254. X! #ifdef M_XENIX
  255. X! #define SMAIL        "/usr/bin/smail"
  256. X! #else
  257. X! #define SMAIL        "/bin/smail"
  258. X  #endif
  259. X***************
  260. X*** 165,166 ****
  261. X--- 212,214 ----
  262. X  #endif
  263. X+ #endif
  264. X  
  265. X***************
  266. X*** 179,182 ****
  267. X  
  268. X! #define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  269. X! /*#define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  270. X  
  271. X--- 227,230 ----
  272. X  
  273. X! /*#define RMAIL(flags,from,sys) "%s -a%s %s - %s!rmail",UUX,from,flags,sys /* */
  274. X! #define RMAIL(flags,from,sys) "%s %s - %s!rmail",UUX,flags,sys /* */
  275. X  
  276. X***************
  277. X*** 187,188 ****
  278. X--- 235,238 ----
  279. X  
  280. X+     /* We're letting sendmail do lots of work for us. */
  281. X+ 
  282. X  #define HANDLE    JUSTUUCP    /* see HANDLE definition below */
  283. X***************
  284. X*** 195,197 ****
  285. X  
  286. X! #else
  287. X  
  288. X--- 245,247 ----
  289. X  
  290. X! #else  /* !SENDMAIL */
  291. X  
  292. X***************
  293. X*** 197,200 ****
  294. X  
  295. X! #define HANDLE    ALL
  296. X! #define ROUTING JUSTDOMAIN
  297. X  
  298. X--- 247,249 ----
  299. X  
  300. X!     /* We don't have sendmail, so we'll do the work ourselves. */
  301. X  
  302. X***************
  303. X*** 200,205 ****
  304. X  
  305. X! #ifdef BSD
  306. X! #define LMAIL(frm,sys)        "/bin/mail"    /* BSD local delivery agent */
  307. X! #else
  308. X! #define LMAIL(frm,sys)        "/bin/lmail"    /* SV  local delivery agent */
  309. X  #endif
  310. X--- 249,255 ----
  311. X  
  312. X! #define HANDLE  ALL             /* see HANDLE definition below */
  313. X! #define ROUTING ALWAYS          /* see ROUTING definition below */
  314. X! 
  315. X! #ifdef BSD              /* BSD local delivery agent */
  316. X! #define LMAIL(frm,sys)          "/bin/mail"
  317. X  #endif
  318. X***************
  319. X*** 206,207 ****
  320. X--- 256,267 ----
  321. X  
  322. X+ #ifdef M_XENIX          /* Xenix local delivery agent (renamed) */
  323. X+ #define EXECMAIL                "/usr/lib/mail/execmail.x"
  324. X+ #define LMAIL(frm,sys)          "%s -m -f '%s'",EXECMAIL,frm
  325. X+ /*#define MICNET                  /* give all mail to execmail, never uux */
  326. X+ #endif
  327. X+ 
  328. X+ #ifndef LMAIL           /* Default local delivery agent */
  329. X+ #define LMAIL(frm,sys)          "/bin/lmail"
  330. X+ #endif
  331. X+ 
  332. X  #define LARG(user)        " '%s'",postmaster(user)
  333. X***************
  334. X*** 210,212 ****
  335. X  
  336. X! #endif
  337. X  
  338. X--- 270,272 ----
  339. X  
  340. X! #endif  /* !SENDMAIL */
  341. X  
  342. X
  343. XIndex: deliver.c
  344. X*** ../smail2.5/deliver.c    Mon Dec 21 18:29:59 1987
  345. X--- ../smail/deliver.c    Wed Dec 23 12:19:33 1987
  346. X***************
  347. X*** 7,8 ****
  348. X--- 7,24 ----
  349. X  
  350. X+ /*
  351. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  352. X+ **    Released to Usenet on 01 Dec 1987.
  353. X+ **    Further modified 23 Dec 1987.
  354. X+ **
  355. X+ **    Additions:
  356. X+ **
  357. X+ **        If MICNET is defined, then LMAIL (execmail) is used to
  358. X+ **        deliver all mail, even remote mail.  See defs.h for a
  359. X+ **        discussion of the tradeoffs of this feature.
  360. X+ **
  361. X+ **        Some #ifdefs are now SMARTMAILER instead of SENDMAIL.
  362. X+ **        This is because execmail has some of the intelligent
  363. X+ **        features of sendmail, i.e. automatic mail return.
  364. X+ */
  365. X+ 
  366. X  #ifndef lint
  367. X***************
  368. X*** 219,222 ****
  369. X              command = scommand;
  370. X-         } else if (form == LOCAL) {
  371. X-             command = lcommand;
  372. X          } else {
  373. X--- 235,236 ----
  374. X***************
  375. X*** 222,226 ****
  376. X          } else {
  377. X!             command = rcommand;
  378. X!             if(flags == uux_noqueue) {
  379. X!                 noqcnt++;
  380. X              }
  381. X--- 236,250 ----
  382. X          } else {
  383. X! #ifdef MICNET
  384. X!             /* Xenix system running Micnet -- let execmail
  385. X!              * handle all messages except retries.
  386. X!              */
  387. X!             command = lcommand;
  388. X! #else
  389. X!             if (form == LOCAL) {
  390. X!                 command = lcommand;
  391. X!             } else {
  392. X!                 command = rcommand;
  393. X!                 if(flags == uux_noqueue) {
  394. X!                     noqcnt++;
  395. X!                 }
  396. X              }
  397. X***************
  398. X*** 226,227 ****
  399. X--- 250,252 ----
  400. X              }
  401. X+ #endif
  402. X          }
  403. X***************
  404. X*** 271,273 ****
  405. X          if (form == LOCAL) {
  406. X! #ifdef SENDMAIL
  407. X              (void) sprintf(buf, LFROM(from, nows, hostname));
  408. X--- 296,298 ----
  409. X          if (form == LOCAL) {
  410. X! #ifdef SMARTMAILER
  411. X              (void) sprintf(buf, LFROM(from, nows, hostname));
  412. X***************
  413. X*** 283,285 ****
  414. X              } else {
  415. X!                 *p = NULL;
  416. X                  (void) sprintf(buf, RFROM(p+1, nows, from));
  417. X--- 308,310 ----
  418. X              } else {
  419. X!                 *p = '\0';
  420. X                  (void) sprintf(buf, RFROM(p+1, nows, from));
  421. X***************
  422. X*** 372,378 ****
  423. X                      (void) fseek(spoolfp, message, 0);
  424. X! #ifdef SENDMAIL
  425. X!                     /* if we have sendmail, then it
  426. X!                     ** was handed the mail, which failed.
  427. X!                     ** sendmail returns the failed mail
  428. X!                     ** for us, so we need not do it again.
  429. X                      */
  430. X--- 397,402 ----
  431. X                      (void) fseek(spoolfp, message, 0);
  432. X! #ifdef SMARTMAILER
  433. X!                     /* Mail is automatically returned
  434. X!                     ** by sendmail and execmail, so we
  435. X!                     ** need not do it again.
  436. X                      */
  437. X
  438. XIndex: headers.c
  439. X*** ../smail2.5/headers.c    Mon Dec 21 18:30:06 1987
  440. X--- ../smail/headers.c    Wed Dec 23 12:26:43 1987
  441. X***************
  442. X*** 5,6 ****
  443. X--- 5,18 ----
  444. X  
  445. X+ /*
  446. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  447. X+ **    Released to Usenet on 01 Dec 1987.
  448. X+ **    Further modified 23 Dec 1987.
  449. X+ **
  450. X+ **    Additions:
  451. X+ **
  452. X+ **        Understand "a%b" to mean "a@b".  (This is a judgement call.
  453. X+ **        I prefer to accept any mail that I can understand, not just
  454. X+ **        that which is "correct.")
  455. X+ */
  456. X+ 
  457. X  #ifndef lint
  458. X***************
  459. X*** 155,156 ****
  460. X--- 167,179 ----
  461. X      }
  462. X+ /*
  463. X+ **  Try splitting at %.  If it works, this is user%domain, which we choose
  464. X+ **  to understand as user@domain.  Prefer the righthand % in a%b%c.
  465. X+ **  (This code allows 'user%foo@mydom' to mean '@mydom,user@foo'.)
  466. X+ */
  467. X+     if ((parts = ssplit(address, '%', partv)) >= 2) {
  468. X+         (void) strcpy(domain, partv[parts-1]);
  469. X+         (void) strncpy(user, partv[0], partv[parts-1]-partv[0]-1);
  470. X+         user[partv[parts-1]-partv[0]-1] = '\0';
  471. X+         return (DOMAIN);
  472. X+     } 
  473. X  /* 
  474. X
  475. XIndex: misc.c
  476. X*** ../smail2.5/misc.c    Mon Dec 21 18:30:19 1987
  477. X--- ../smail/misc.c    Wed Dec 23 12:30:02 1987
  478. X***************
  479. X*** 5,6 ****
  480. X--- 5,21 ----
  481. X  
  482. X+ /*
  483. X+ **    Modified for SCO Xenix by Chip Salzenberg (chip@ateng.UUCP).
  484. X+ **    Released to Usenet on 01 Dec 1987.
  485. X+ **    Further modified 23 Dec 1987.
  486. X+ **
  487. X+ **    Additions:
  488. X+ **
  489. X+ **        If HOSTFILE is defined, read it to look for the hostname.
  490. X+ **        (This file is typically "/etc/systemid" on Xenix systems.)
  491. X+ **        If HOSTFILE is missing, try uname() or gethostname().
  492. X+ **
  493. X+ **        Write only the basename of the program in the log file,
  494. X+ **        just to make the log file easier to read.
  495. X+ */
  496. X+ 
  497. X  #ifndef lint
  498. X***************
  499. X*** 53,57 ****
  500. X  
  501. X!     logtime = strcpy(tbuf, nows);
  502. X!     logtime[16] = '\0';
  503. X!     logtime += 4;
  504. X  
  505. X--- 68,75 ----
  506. X  
  507. X!     /* To make the log file look nicer, show only the basename of
  508. X!      * the command.
  509. X!      */
  510. X!     if (*command == '/')
  511. X!     {
  512. X!         char *p, *ecmd;
  513. X  
  514. X***************
  515. X*** 57,58 ****
  516. X--- 75,92 ----
  517. X  
  518. X+         if ( (ecmd = index(command, ' ')) != 0 )
  519. X+             *ecmd = '\0';
  520. X+ 
  521. X+         if ( (p = rindex(command, '/')) != 0 )
  522. X+             command = p + 1;
  523. X+ 
  524. X+         if ( ecmd != 0 )
  525. X+             *ecmd = ' ';
  526. X+     }
  527. X+ 
  528. X+     /* Time (now).
  529. X+      */
  530. X+     strcpy(tbuf, nows);
  531. X+     tbuf[16] = '\0';
  532. X+     logtime = &tbuf[4];
  533. X+ 
  534. X      cmask = umask(0);
  535. X***************
  536. X*** 313,314 ****
  537. X--- 347,363 ----
  538. X          (void) strcpy(hostname, HOSTNAME);
  539. X+ #endif
  540. X+ #ifdef HOSTFILE
  541. X+     if (!*hostname) {
  542. X+         FILE *fp;
  543. X+         char *p;
  544. X+ 
  545. X+         if ((fp = fopen(HOSTFILE, "r")) != NULL) {
  546. X+             if (fgets(hostname, SMLBUF - 1, fp) != NULL
  547. X+              && (p = index(hostname, '\n')) != NULL)
  548. X+                 *p = '\0';
  549. X+             else
  550. X+                 *hostname = '\0';
  551. X+             fclose(fp);
  552. X+         }
  553. X+     }
  554. X  #endif
  555. X
  556. XIndex: nptx.c
  557. X*** ../smail2.5/nptx.c    Mon Dec 21 18:30:20 1987
  558. X--- ../smail/nptx.c    Thu Sep 24 13:07:13 1987
  559. X***************
  560. X*** 127,129 ****
  561. X          (void) strcpy(nl[i], p+1);
  562. X!         *p = NULL;
  563. X      }
  564. X--- 127,129 ----
  565. X          (void) strcpy(nl[i], p+1);
  566. X!         *p = '\0';
  567. X      }
  568. X***************
  569. X*** 164,166 ****
  570. X              (void) strcpy(il[ii], pi+1);
  571. X!             *pi = NULL;
  572. X          }
  573. X--- 164,166 ----
  574. X              (void) strcpy(il[ii], pi+1);
  575. X!             *pi = '\0';
  576. X          }
  577. SHAR_EOF
  578. if test 10886 -ne `wc -c < 'X.PATCHES'`
  579. then
  580.     echo 'shar: error transmitting "X.PATCHES" (should have been 10886 characters) '
  581. fi
  582. chmod 644 'X.PATCHES'
  583. fi  # end of overwriting check
  584. :
  585. echo 'shar: extracting "Makefile" (1427 characters) '
  586. if test -f 'Makefile'
  587. then
  588.     echo 'shar: will not overwrite existing file "Makefile" '
  589. else
  590. sed 's/^X//' << \SHAR_EOF > 'Makefile'
  591. X# Makefile for smail
  592. X# @(#)Makefile    2.5 (smail) 9/15/87
  593. X#
  594. X# Modified for SCO Xenix by Chip Salzenberg <chip@ateng.UUCP>.
  595. X# Released to Usenet on 01 Dec 1987.
  596. X# Fixed as per comments of Chris Lewis <uunet!mnetor!spectrix!clewis>.
  597. X#
  598. X# With the addition of the `xenix' pseudo-target, this makefile now makes
  599. X# both smail and execm by default.
  600. X#
  601. X# Use the `install_smail' script to install the resulting binaries.
  602. X
  603. XCFLAGS    = -O
  604. XLDFLAGS = -i
  605. XSHELL    = /bin/sh
  606. XCOPY    = copy -om
  607. X
  608. X#
  609. X# System V Release 2.0 sites can use -lmalloc for a faster malloc
  610. X#
  611. X#LIBS    =    -lmalloc
  612. X
  613. XOBJECTS =    main.o map.o resolve.o deliver.o misc.o alias.o pw.o headers.o getpath.o str.o getopt.o
  614. X
  615. Xxenix:  smail execm
  616. Xall:    smail svbinmail lcasep pathproc mkfnames nptx execm
  617. X
  618. Xsmail:        $(OBJECTS)
  619. X        $(CC) $(LDFLAGS) -F 4000 $(OBJECTS) -o smail $(LIBS)
  620. X
  621. X$(OBJECTS):    defs.h
  622. X        $(CC) $(CFLAGS) -c $<
  623. X
  624. Xexecm:          execm.c
  625. X        $(CC) $(CFLAGS) $(LDFLAGS) execm.c -o execm
  626. X
  627. Xsvbinmail:    svbinmail.c defs.h
  628. X        $(CC) $(CFLAGS) $(LDFLAGS) svbinmail.c -o svbinmail
  629. X
  630. Xlcasep:        lcasep.c
  631. X        $(CC) $(CFLAGS) $(LDFLAGS) lcasep.c -o lcasep
  632. X
  633. Xpathproc:    pathproc.sh
  634. X        $(COPY) pathproc.sh pathproc
  635. X        chmod 755 pathproc
  636. X
  637. Xmkfnames:    mkfnames.sh
  638. X        $(COPY) mkfnames.sh mkfnames
  639. X        chmod 755 mkfnames
  640. X
  641. Xnptx:        nptx.o pw.o str.o
  642. X        $(CC) $(CFLAGS) nptx.o pw.o str.o -o nptx $(LIBS)
  643. X
  644. Xclean:
  645. X        rm -f *.o *.ln a.out core
  646. X
  647. Xclobber:    clean
  648. X        rm -f smail rmail lcasep pathproc mkfnames svbinmail nptx execm
  649. SHAR_EOF
  650. if test 1427 -ne `wc -c < 'Makefile'`
  651. then
  652.     echo 'shar: error transmitting "Makefile" (should have been 1427 characters) '
  653. fi
  654. chmod 644 'Makefile'
  655. fi  # end of overwriting check
  656. :
  657. echo 'shar: extracting "execm.c" (747 characters) '
  658. if test -f 'execm.c'
  659. then
  660.     echo 'shar: will not overwrite existing file "execm.c" '
  661. else
  662. sed 's/^X//' << \SHAR_EOF > 'execm.c'
  663. X/*
  664. X * execm.c
  665. X *
  666. X * This program is a substitute for Xenix's /usr/lib/mail/execmail.
  667. X *
  668. X * Written by Chip Salzenberg (chip@ateng.UUCP).
  669. X * Released to Usenet on 01 Dec 1987.
  670. X *
  671. X * Do what you want with it; I'm not responsible for lost mail,
  672. X * but I don't expect that this little program will lose anything.
  673. X */
  674. X
  675. X#include <stdio.h>
  676. X
  677. Xmain(argc, argv)
  678. Xint     argc;
  679. Xchar    **argv;
  680. X{
  681. X    char *progname = argv[0];
  682. X
  683. X    /*
  684. X     * Drop the execmail options.
  685. X     */
  686. X    while (argv[1][0] == '-')
  687. X    {
  688. X        switch (argv[1][1])
  689. X        {
  690. X        case 'f':
  691. X        case 'h':
  692. X            argv += 2;
  693. X            break;
  694. X        default:
  695. X            ++argv;
  696. X            break;
  697. X        }
  698. X    }
  699. X
  700. X    argv[0] = progname;
  701. X    execv("/usr/bin/smail", argv);
  702. X    execv("/bin/smail", argv);
  703. X
  704. X    fprintf(stderr, "%s: can't execute smail!\n", progname);
  705. X    exit(1);
  706. X}
  707. SHAR_EOF
  708. if test 747 -ne `wc -c < 'execm.c'`
  709. then
  710.     echo 'shar: error transmitting "execm.c" (should have been 747 characters) '
  711. fi
  712. chmod 644 'execm.c'
  713. fi  # end of overwriting check
  714. :
  715. echo 'shar: extracting "install_smail" (1137 characters) '
  716. if test -f 'install_smail'
  717. then
  718.     echo 'shar: will not overwrite existing file "install_smail" '
  719. else
  720. sed 's/^X//' << \SHAR_EOF > 'install_smail'
  721. X: install_smail
  722. X# Shell script to install smail in a Xenix System V system.
  723. X#
  724. X# Written by Chip Salzenberg (chip@ateng.UUCP).
  725. X# Released to Usenet on 01 Dec 1987.
  726. X#
  727. X# Note that this script renames the standard Xenix rmail and execmail
  728. X# programs to rmail.x and execmail.x respectively.  If those `.x' files
  729. X# already exist, then no renaming takes place, so you can run this script
  730. X# more than once without losing those renamed programs.
  731. X#
  732. X# BTW, be sure to test everything thoroughly; a broken mail system is
  733. X# sure to upset any users on your system.
  734. X
  735. XCOPY="copy -m"
  736. XSMAIL="/usr/bin/smail"
  737. XRMAIL="/usr/bin/rmail"
  738. XEXECM="/usr/lib/mail/execmail"
  739. X
  740. Xfor f in smail execm
  741. Xdo
  742. X    if [ ! -x $f ]; then
  743. X    echo "You need to compile $f first."
  744. X    exit 1
  745. X    fi
  746. Xdone
  747. X
  748. Xecho "Installing current smail -- you have 5 seconds to abort."
  749. Xsleep 5
  750. X
  751. Xif [ ! -f $RMAIL.x ]; then
  752. X    mv $RMAIL $RMAIL.x
  753. Xfi
  754. Xrm -f $RMAIL
  755. Xif [ ! -f $EXECM.x ]; then
  756. X    mv $EXECM $EXECM.x
  757. Xfi
  758. Xrm -f $EXECM
  759. X
  760. X$COPY execm $EXECM
  761. Xchown bin $EXECM
  762. Xchgrp bin $EXECM
  763. Xchmod 755 $EXECM
  764. X
  765. Xrm -f $SMAIL $RMAIL
  766. X$COPY smail $SMAIL
  767. Xchown bin $SMAIL
  768. Xchgrp bin $SMAIL
  769. Xchmod 755 $SMAIL
  770. Xln $SMAIL $RMAIL
  771. SHAR_EOF
  772. if test 1137 -ne `wc -c < 'install_smail'`
  773. then
  774.     echo 'shar: error transmitting "install_smail" (should have been 1137 characters) '
  775. fi
  776. chmod 755 'install_smail'
  777. fi  # end of overwriting check
  778. #    End of shell archive
  779. exit 0
  780.  
  781. --
  782. Chip Salzenberg                 UUCP: "{codas,uunet}!ateng!chip" 
  783. A T Engineering             My employer's opinions are a trade secret.
  784. Chip's Observation:  "Anything that works is better than anything that doesn't."
  785.